﻿//-----------------------------------------------------------------------
// <copyright file="DiagnosticsServiceProxy.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Silverlight.Services
{
    using System;

    using System.Collections;
    using System.Collections.Generic;

    using System.ServiceModel;
    using System.ServiceModel.Channels;

    using System.Xml;
    using System.Xml.Linq;

    using CodePlex.Diagnostics.Silverlight.Contracts;

    /// <summary>
    /// Provides the service proxy for the <see cref="T:CodePlex.Diagnostics.Contracts.IDiagnosticsService"/>.
    /// </summary>
    public class DiagnosticsServiceClient : ClientBase<IDiagnosticsService>, IDiagnosticsService
    {
        #region public IAsyncResult BeginRegisterTeamFoundationServer(TeamFoundationServerDataContract contract)

        /// <summary>
        /// Asynchronously registers the Team Foundation Server specified by the supplied <see cref="T:Uri"/> within the CodePlex.Diagnostics database.
        /// </summary>
        /// <param name="contract">The <see cref="T:CodePlex.Diagnostics.Contracts.TeamFoundationServerDataContract"/> representing the Team Foundation Server to be registered within the database.</param>
        /// <param name="callback"></param>
        /// <param name="state"></param>
        public IAsyncResult BeginRegisterTeamFoundationServer(TeamFoundationServerDataContract contract, AsyncCallback callback, object state)
        {
            return this.Channel.BeginRegisterTeamFoundationServer(contract, callback, state);
        }

        #endregion

        #region public void EndRegisterTeamFoundationServer(IAsyncResult result)

        /// <summary>
        /// Completes an asynchronous operation to accept a register a Team Foundation Server.
        /// </summary>
        /// <param name="result">The <see cref="T:IAsyncResult"/> returned by a call to the <see cref="M:BeginRegisterTeamFoundationServer"/> method.</param>
        public void EndRegisterTeamFoundationServer(IAsyncResult result)
        {
            this.Channel.EndRegisterTeamFoundationServer(result);
        }

        #endregion
    }
}
